<!doctype html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>注册</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <link href="__STATIC__/mobile/css/mui.min.css" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="__STATIC__/mobile/css/main.css"/>
    <include file="Public:iframe_header"/>
    <style type="text/css">
        *{
            font-size: 95%;
            font-family: "微软雅黑";
        }
        .r-div{
            padding-top: 30px;
            margin:  auto;
            width: 100%;
        }
        input[type=text],input[type=password]{
            padding: 8px;
            margin: 10px auto;
            width: 70%;
            border: 1px solid #F9BC30;
            background-color: #fff;
            font-size: 14px;
            border-radius: 0px;
            height:34px;
        }
        p{
            color: #F0AD4E;
            font-size: 20px;
        }
        input[type=button]{
            width: 70%;
            color: black;
            background-color: #F9BB30;
            border: 1px solid #F9BC30;
            margin: 10px auto;
            height:34px;
            border-radius: 0px;
        }
        html{
            background-image: url(__STATIC__/mobile/img/z-bg.png);
            background-size: cover;
            background-size: 100% 100%;
            background-repeat: no-repeat;
            background-position: center;
            width: 100%;
            min-height: 100%;
            height: auto;
            padding: 0;
            margin: 0;
        }
        body{
            width: 100%;
            height: 100%;
            padding: 0;
            margin: 0;
            background-color: rgba(0,0,0,0);
        }
        div{
            width: auto;
            padding: 0;
            margin: 0;
            text-align: center;
        }
        .mui-content{
            background-color: rgba(0,0,0,0);
        }
        .yzm{
            display: flex;
            justify-content: center;
            align-items: center;
            margin: 0;
            padding: 0;
        }
        .yzm input{
            padding: 8px;
            margin: 10px 0 10px auto;
            width: 40%;
            border: 1px solid #F9BC30;
            background-color: #fff;
            font-size: 14px;


        }
        .yzm img{
            margin: 10px auto 10px 0;
            padding:auto 0;
            width: 30%;
            border: 1px solid #F9BC30;
        }
    </style>
</head>

<body>
<div class="mui-content"  align="center">

    <div class="r-div">
        <p>欢迎注册</p>
        <div class="">
            <input placeholder="请输入账号" type="text" name="account2" id="account2" value="" /><br />
            <input placeholder="请输入真实姓名" type="text" name="account3" id="account3" value="" /><br />
            <input placeholder="请输入公司名" type="text" name="company" id="company" value="" /><br />
            <input placeholder="请输入手机号" type="text" name="mobile" id="mobile" value="" /><br />
        </div>
        <div class="yzm">
            <input placeholder="验证码" type="text" name="verifyCode" id="verifyCode" value="" />
            <img src="/mobile/Login/captchaImg" height="34px" class="vcode" title="换一张" />
        </div>
        <div class="">
            <input placeholder="请输入密码" type="password" name="passwd" id="passwd" value="" /><br />
            <input type="button" name="" id="btn_reg" value="注册" />
            <!--
                作者：offline
                时间：2018-06-26
                描述：	<input type="button" name="" id="" value="返回" onclick="back()"/><br />
            -->

        </div>
        <br />
		    	<span id="">
		    		已有账号！
		    	</span>
		    	<span id="" style="color: #EC971F" onclick="tologin()">
		    		立即登录
		    	</span>
    </div>



</div>

<script src="__STATIC__/mobile/js/mui.min.js"></script>
<script type="text/javascript">
    mui.init();
    function back(){
        window.history.go(-1);
    }
    function tologin(){
        window.parent.document.getElementById("ifpage").src = "{:url('Login/login')}";
    }
</script>
<script>
    $(".vcode").click(function(){
        if( $(this).attr("src").indexOf('?')>0){
            $(this).attr("src", $(this).attr("src")+'&random='+Math.random());
        }else{
            $(this).attr("src", $(this).attr("src").replace(/\?.*$/,'')+'?'+Math.random());
        }
    });

    $('#btn_reg').click(function (event) {
        if($("#account2").val()==""){
            parent.tips('账号不能为空');
            return false;
        }
        if($("#account3").val()==""){
            parent.tips('姓名不能为空');
            return false;
        }
        if($("#company").val()==""){
            parent.tips('公司名不能为空');
            return false;
        }
        if($("#mobile").val()==""){
            parent.tips('手机号码不能为空');
            return false;
        }

        if($("#verifyCode").val()==""){
            parent.tips('验证码不能为空');

            return false;
        }

        if($("#passwd").val()==""){
            parent.tips('密码不能为空');
            return false;
        }
        var account = $("input[name='account2']").val();
        var account3 = $("input[name='account3']").val();
        var passwd = $("input[name='passwd']").val();
        var company = $("input[name='company']").val();
        var mobile = $("input[name='mobile']").val();
        var verifyCode = $("input[name='verifyCode']").val();

        $.post("{:url('Login/register')}",{account:account,account3:account3,company:company,mobile:mobile,passwd:passwd,verifyCode:verifyCode},function(result){
            if(result.code == '0'){
                parent.tips(result.msg);
                return false;
            }else{
                parent.tips(result.msg);

                location.href = result.url;
            }
        });

        return false;
    });
</script>
</body>

</html>